/**
 * @ByteBeanDemo.java  COPYRIGHT xiaojian
 * 
 * Created on 2017年6月26日 上午11:35:28
 */
package xj.toolkit.bean.bytebean;

import org.apache.commons.lang3.builder.ToStringBuilder;

import xj.toolkit.bean.bytebean.annotation.ByteBeanField;

/**
 * @author <a href="mailto:cxj2000@gmail.com">xiaojian.cao</a>
 *
 */
public class ByteBeanDemo {

	@ByteBeanField(index = 0)
	private int nameLen = -1;

	@ByteBeanField(index = 1, lenField = "nameLen")
	private String name = null;

	@ByteBeanField(index = 2)
	private int age = 0;

	@ByteBeanField(index = 3)
	private float f1 = 0.1f;

	@ByteBeanField(index = 4)
	private float f2 = 0.2f;

	@ByteBeanField(index = 5)
	private double d = 0.2d;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
		this.nameLen = name.length();
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public float getF1() {
		return f1;
	}

	public void setF1(float f1) {
		this.f1 = f1;
	}

	public float getF2() {
		return f2;
	}

	public void setF2(float f2) {
		this.f2 = f2;
	}

	public double getD() {
		return d;
	}

	public void setD(double d) {
		this.d = d;
	}

	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}
